<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>

 
<link href="/admin/css/style.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="/admin/js/jquery.js"></script>
<link rel="stylesheet" href="admin/kindeditor/themes/default/default.css" />
 <script charset="utf-8" src="admin/kindeditor/kindeditor-min.js"></script>
 <script charset="utf-8" src="admin/kindeditor/lang/zh_CN.js"></script>
 <script type="text/javascript" src="/admin/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="<{$weburl}>//admin/js/cal.js"></script>
 <script type="text/javascript" src="/admin/js/common.js"></script>
  <script type="text/javascript" src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<style>
	.pagination li{
		width: 20px;
        height: 20px;
        /*border: 1px solid gray;*/
        margin-left: 1px;
        float:left;
	}
</style>

<!-- // $(document).ready(function() {
//     //品牌选择
// 	$("#brand").change(function(){
// 		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
// 			brandid :  $("#brand").val() 
// 		}, function (data, textStatus){
//                $("#subbrand").html(data); // 把返回的数据添加到页面上
// 			}
// 		);
// 	});

// 	//品牌选择
// 	$("#subbrand").change(function(){
// 		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
// 			subbrandid :  $("#subbrand").val() 
// 		}, function (data, textStatus){
//                $("#subsubbrand").html(data); // 把返回的数据添加到页面上
// 			}
// 		);
// 	});
// })
 -->
</head>
<body>
<div class="colorarea01">
	<div class="search clearfix">
		<div class="searchL">
			<ul class="menulist">
            <li><a href="{{url('brands/addcm')}}" class="add">添加车型</a></li>
			</ul>
		</div>
        <div class="searchR">
			<form action="" method="get" name="form2">
			<input type="hidden" name="m" value="carmodel">
			<input type="hidden" name="a" value="list">
			<em>
			<select name="p_brand" id="brand"  datatype="n" nullmsg="请选择品牌！">
				<option value="">请选择品牌</option>
					@foreach ($cars as $c)
						<option value="{{$c->b_id}}" onClick="cx()"><span>{{$c->mark}}</span>{{$c->b_name}}</option>	
						@endforeach	

			</select>
			</em>&nbsp;&nbsp;
			<span id="span"></span>
			<script>
              function cx(){
              	var b_id = $('select[name=p_brand] option:selected').val();
              	$.ajax({
              		url:"{{'getcx'}}",
              		data:{'b_id':b_id},
              		dataType:'json',
              		type:'get',
              		 success:function(msg){
              		 	
                     var s = "";
                        s += "<select name ='p_subbrand' id='subbrand'>";
                        s += "<option value='0'>--请选择--</option>";
                        $.each(msg,function(kk,vv){
                           s+="<option value='"+vv.b_id+"' >"+vv.b_name+"</option>";
                        });
                        s += "</select>";
                    $('#subbrand').remove();
                    $('em').append(s);
                }
              	});
              }
			</script>
			<select class="subbrand" id="subbrand" name="p_subbrand" datatype="n" nullmsg="请选择车系！">
						<option  value="">请选择车系</option>
						                  
					</select>             
			
            <span><input type="submit" name="filtersubmit" value="查询" class="combutton02 w50"></span>
			</form>
		</div> 
	</div>
    <form action="<{$adminpage}>?m=carmodel" method="post" name="form">
	<!-- <{if $types == 2}> -->
		<table cellspacing="0" cellpadding="0" width="100%"  class="listtable">
		<tr>
			<th width="30">选择</th>
			<th>ID</th>
			<th width="60">排序</th>
			<th align="left">品牌</th>
			<th>车型</th><th>款式</th>
			<th>操作</th>
		</tr>
		  @foreach ($data as $d)
			<tr bgcolor="#ffffff" onmouseover="style.backgroundColor='#E2E9EA'"  onmouseout="style.backgroundColor='#ffffff'">
            <td align="center"><input type="checkbox" name="bulkid[]" value="<{$brand.b_id}>"></td>
				<td align="center">{{$d->b_id}}</td>
                <td align="center"><input type="text" size="5" name="orderid[<{$brand.b_id}>]" value="" class="ip01"></td>
				<td align="left">&nbsp;&nbsp;{{$d->b_name}}&nbsp;&nbsp;
					<!-- @{{$d->b_type}} -->
					&nbsp;&nbsp;</td>
				<td align="center">
				@foreach ($cars as $c)
					@if($d->b_id == $c->b_parent)
					{{$c->b_name}}<br />
					@endif
				@endforeach
				</td>
				<td align="center">
				@foreach ($types as $t)
					@if($c->b_id == $t->b_parent)
					{{$c->b_name}}<br />
					@endif
				@endforeach
				</td>
                <td align="center" class="rightmenu">
                	<a href="{{url('brands/edit',['b_id'=>$d->b_id])}}" class="edit">编辑款式</a>| 
                	<a href="{{url('brands/editmodel',['b_id'=>$d->b_id])}}" class="edit">编辑车型</a>|  
                	<a href="javascript:if(confirm('确实要删除款式以及款式下的所有车型吗?')) " class="del">删除款式</a>|
                	<a href="{{url('brands/del',['b_id'=>$d->b_id])}}" class="del">删除车型</a>
                </td>
			</tr>
		@endforeach	
        <tr><td colspan="7" class="buttontd"><a href="javascript:selectAll();" title="请选择后操作">全选</a> <a href="javascript:submitForm('<{$adminpage}>?m=carmodel&a=bulkdel','删除');" title="请选择后操作">删除</a> <a href="javascript:submitForm('<{$adminpage}>?m=carmodel&a=bulksort','更新排序');" title="请选择后操作">更新排序</a></td></tr>
        </form>
        <!-- {!!$data->render()!!} -->
	</table>
	<div class="listpage">{!!$data->render()!!}</div>
	<!-- <{else}>
	<table cellspacing="0" cellpadding="0" width="100%"  class="listtable">
		<tr><th width="30">选择</th><th>ID</th><th width="60">排序</th><th align="left">品牌</th><th>车型</th><th>款式</th><th>操作</th></tr>
		<{foreach from=$brandlist item=brand}>
			<{foreach from=$brand.brands_list item=subbrandlist}>
				<{foreach from=$subbrandlist.subbrands_list item=subsubbrandlist}>
				<tr bgcolor="#ffffff" onmouseover="style.backgroundColor='#E2E9EA'"  onmouseout="style.backgroundColor='#ffffff'">
	                    <td align="center"><input type="checkbox" name="bulkid[]" value="<{$subsubbrandlist.b_id}>"></td>
					<td align="center"><{$subsubbrandlist.b_id}></td>
	                    <td align="center"><input type="text" size="5" name="orderid[<{$subsubbrandlist.b_id}>]" value="<{$subsubbrandlist.orderid}>" class="ip01"></td>
					<td align="left"><{$brand.b_name}>&nbsp;&nbsp;<{$subbrandlist.b_name}>&nbsp;&nbsp;<{$subsubbrandlist.b_name}></td>
					<td align="center"><{$brand.b_name}></td>
					<td align="center"><{$subbrandlist.b_name}></td>
	                     <td align="center" class="rightmenu"><a href="<{$adminpage}>?m=carmodel&a=editcarstyle&b_id=<{$subbrandlist.b_id}>" class="edit">编辑款式</a> | <a href="<{$adminpage}>?m=carmodel&a=edit&b_id=<{$subsubbrandlist.b_id}>" class="edit">编辑车型</a> | <a href="javascript:if(confirm('确实要删除款式以及款式下的所有车型吗?'))location='<{$adminpage}>?m=carmodel&a=del&b_id=<{$subbrandlist.b_id}>'" class="del">删除款式</a> | <a href="javascript:if(confirm('确实要删除吗?'))location='<{$adminpage}>?m=carmodel&a=del&b_id=<{$subsubbrandlist.b_id}>'" class="del">删除车型</a></td>
				</tr>
				<{/foreach}>
			<{/foreach}>
		<{/foreach}>
	        <tr> <td colspan="7" class="buttontd"><a href="javascript:selectAll();" title="请选择后操作">全选</a> <a href="javascript:submitForm('<{$adminpage}>?m=carmodel&a=bulkdel','删除');" title="请选择后操作">删除</a> <a href="javascript:submitForm('<{$adminpage}>?m=carmodel&a=bulksort','更新排序');" title="请选择后操作">更新排序</a></td></tr>
	</table>	
	<{/if}> -->
    </form>
</div>
</body>
</html>